<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">
<head>
    <title>星星专属链接</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <script type="text/javascript" src="/js/jquery-3.1.1.min.js"></script>
    <script type="text/javascript" src="/js/layer/layer.js"></script>
    <script type="text/javascript" src="/js/vue.min.js"></script>
    <script type="text/javascript" src="http://static.guduomedia.com/laydate/laydate.js"></script>
    <link rel="stylesheet" media="all" href="http://static.guduomedia.com/laydate/theme/default/laydate.css"  />
</head>
<body>

<div id="app">
    <div class="form-group">
        <label >种子地址</label>
        <input style="width:500px"type="text" class="form-control" id="seedName" v-model="seedName">
    </div>

    <div>
        <button @click="addSeed()">提交</button>
    </div>

    </br>
    <div>
        <button @click="toTable()">跳转至表格</button>
    </div>
</div>


</body>
</html>
<script>

    laydate.render({
        elem: '#test1'
    });

    var app = new Vue({
        el: '#app',
        data: {
            seedName: '',
        },
        methods: {
            toTable: function () {
                window.open('http://grafana.mlamp.xyz','_blank');
            },
            addSeed: function () {
                var seedName = this.seedName;
                if(seedName == ''){
                    layer.msg('请输入种子地址');
                    return false;
                }
                $.ajax({
                    url: '/lofter/updateSeed?url='+seedName,
                    type: 'get',
                    success: function (res) {
                        if(res == 'success'){
                            layer.msg('添加成功');
                        }else{
                            layer.msg(res);
                        }
                    }
                })
            }
        }
    })

</script>

